<template>
<!--    实施-->
    <div style="padding: 15px">
        <a-table :data-source="dataSource"  :columns="columns" bordered :pagination="false" :loading="loading"></a-table>
    </div>

</template>

<script>
  import { getDetails } from '@/api/technical/approval'

  export default {
    name: 'putIntoEffect',
    data() {
      return {
        form: {},
        dataSource: [],
        columns: [
          {
            title: '实施日期',
            dataIndex: 'date',
            width: 220
          },
          {
            title: '状态',
            dataIndex: 'implStatus'
          }
        ],
        loading: false
      }
    },
    created() {
      // 后端不想做版本 所以会重复掉接口
      this.getDetails()
    },
    methods: {
      getDetails() {
        this.loading = true
        getDetails({id:this.$route.query.conId}).then(res=>{
          this.form = res.data
          this.loading = false
          let versionNumber = this.$route.query.versionNumber
          if(this.form.implRecordInfo?.length) {
            let arr = this.form.implRecordInfo.filter(item => item.versionNum == versionNumber)
            this.dataSource = arr
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>